package myPack.GMAO.Bean;

import java.io.Serializable;
import java.util.List;

import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;

import myPack.GMAO.Entity.BMP;
import myPack.GMAO.Interface.BMPInterface;

@Stateless
public class BMPBean implements BMPInterface 
{
	@PersistenceContext
	EntityManager em;
	
	@Override
	public void Ajouter(BMP b) {
		em.persist(b);
	}
	@Override
	public void Supprimer(int idMP) {
		em.remove(em.find(BMP.class, idMP));
		
	}
	@Override
	public List<BMP> Lister() {
		return em.createQuery("from BMP").getResultList();
	}
}
